﻿using Azure.QPCR;
using Azure2Java.QPCRAdapter.Adapter.Entity;

namespace Azure2Java.QPCRAdapter.Adapter {

    /**
     * @author zy gws ssc
     * @date 18.12.22
     * @update 19.12.06
     * @decription ProgramProcesser代理类
     * ProgramProcesser是运行程序处理类
     */
    public class ProgramProcesserAdapter {
        private ProgramProcesser ProgramProcesser;

        public ProgramProcesserAdapter() {
            ProgramProcesser = new ProgramProcesser();
        }

        public ProgramProcesserAdapter(ProgramProcesser ProgramProcesser) {
            this.ProgramProcesser = ProgramProcesser;
        }

        // 暂时不要使用，修改中；将 XML 格式的程序转换为 Program 结构体
        public ProgramBean fromXml(string filePath) {
            return new ProgramBean(ProgramProcesser.FromXml(filePath));
        }

        // 将 Program 结构体程序转换为XML格式
        public bool toXml(ProgramBean programAdapter, string filePath) {
            return ProgramProcesser.ToXml(programAdapter.Program, filePath);
        }
    }
}
